load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "affine_point",
    hdrs = ["affine_point.h"],
    deps = [":point_conversions_forward"],
)

tachyon_cc_library(
    name = "curve_type",
    hdrs = ["curve_type.h"],
)

tachyon_cc_library(
    name = "dimensions",
    hdrs = ["dimensions.h"],
    deps = [
        "//tachyon:export",
        "//tachyon/base/buffer:copyable",
        "//tachyon/base/json",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "jacobian_point",
    hdrs = ["jacobian_point.h"],
    deps = [
        ":point3",
        ":point_conversions_forward",
    ],
)

tachyon_cc_library(
    name = "point2",
    hdrs = ["point2.h"],
    deps = [
        "//tachyon/base/buffer:copyable",
        "//tachyon/base/json",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "point3",
    hdrs = ["point3.h"],
    deps = [
        "//tachyon/base/buffer:copyable",
        "//tachyon/base/json",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "point4",
    hdrs = ["point4.h"],
    deps = [
        "//tachyon/base/buffer:copyable",
        "//tachyon/base/json",
        "@com_google_absl//absl/strings",
    ],
)

tachyon_cc_library(
    name = "point_conversions_forward",
    hdrs = ["point_conversions_forward.h"],
)

tachyon_cc_library(
    name = "point_conversions",
    hdrs = ["point_conversions.h"],
    deps = [
        ":affine_point",
        ":jacobian_point",
        ":point_conversions_forward",
        ":point_xyzz",
        ":projective_point",
        "//tachyon/base:template_util",
    ],
)

tachyon_cc_library(
    name = "point_xyzz",
    hdrs = ["point_xyzz.h"],
    deps = [
        ":point4",
        ":point_conversions_forward",
    ],
)

tachyon_cc_library(
    name = "projective_point",
    hdrs = ["projective_point.h"],
    deps = [
        ":point3",
        ":point_conversions_forward",
    ],
)

tachyon_cc_unittest(
    name = "geometry_unittests",
    srcs = [
        "dimensions_unittest.cc",
        "point2_unittest.cc",
        "point3_unittest.cc",
        "point4_unittest.cc",
    ],
    deps = [
        ":dimensions",
        ":point2",
        ":point3",
        ":point4",
        "//tachyon/base/buffer:vector_buffer",
        "//tachyon/math/finite_fields/test:gf7",
    ],
)
